/*
 *  Player.h
 *  RiskAI
 *
 *  Created by Chris on 11/12/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED

#include "Board.h"
#include "RiskAction.h"
#include "Fortification.h"

#include <vector>
#include <string>

class CPlayer
{
public:

	CPlayer(int iIndex, CBoard* pxBoard);
	~CPlayer();
	
	int  GetIndex();
	
	std::vector<int> GetTerritories();
	void GainTerritory(int iTerritory);
	void LoseTerritory(int iTerritory);
	
	bool StillInGame();
	
	// virtual functions overridden in derived classes
	virtual int PickTerritory(std::vector<int> viAvailables);
	virtual int AssignTroops(int iNumTroops);
	virtual int MoveTroops(int iSourceIndex, int iDestinationIndex);
	virtual RiskAction DecideOnAction(std::vector<int> viViableAttackers);
	virtual int PickDefendingDie(int* aiAttackDice, int iTarget);
	virtual CFortification FortifyTroops(std::vector<int> viFortifiers);
	
	std::string GetPlayerInfo();

protected:

	int StrengthOfWeaskestEnemy(int iTerritory);

	int m_iIndex;
	CBoard* m_pxBoard;
		
	std::vector<int> m_viTerritories;
};

#endif // PLAYER_H_INCLUDED